/*
 * Copyright (C) 2017-2019 Dremio Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 @import '~@app/components/colors.less';
 @import '~@app/uiTheme/less/mixins.less';
 @import "~@app/uiTheme/less/variables.complex.less";
 @import "~@app/uiTheme/less/color-schema.less";

 // we should show a spliter/border on the left and add a padding for wiki button
 .wiki-collapsed {
   composes: sidebar-border from '~@app/pages/HomePage/components/Columns.less';
   padding-left: 10px;
 }

 .slider {
   position: absolute;
   top: 0;
   //use right, as on resize I am going to replace right property with distance from cursor position to right edge of sidebar
   right: 100%;
   bottom: 0;
   width: 11px;
   transform: translateX(50%);
   background: @TABLE_BORDER;
   cursor: col-resize;
   opacity: 0;
   z-index: 100;

   &:hover {
     opacity: 1;
   }
 }

 :global { // DX-11429 TODO reafactor component to use css modules instead fo global classes

  .list-content {
    min-width: 500px;
    min-height: ~"calc(100vh - 65px)";
    display: flex;
    flex-grow: 0;
    flex-shrink: 0;
    justify-content: center;
    width: 100%;
  }

  .ReactVirtualized__Table {
    border-collapse: collapse;
    *{
      outline: 0;
    }
    .ReactVirtualized__Table__headerRow {
      height: 39px !important;
      text-transform: initial;
      line-height: 20px;
      vertical-align: bottom;
      border-bottom: 1px solid rgba(0,0,0,.1);
      font-size: 12px;
      font-weight: 500;
    }
    &--noZebraStripesRows {
      cursor: pointer !important;
      border-bottom: 1px solid @DARK_200 !important;
      background: @white !important;
    }
    .ReactVirtualized__Table__row {
      .fontBody();
      height: 30px;
      .action-wrap .main-settings-btn{
        opacity: 0;
        text-decoration: none;
      }
      &.odd {
        background-color: #f9f9f9;
      }
      .copy-button{
        opacity: 0;
        margin: 0 0 0 5px;
      }
      &:hover{
        .action-wrap .main-settings-btn{
          opacity: 1;
        }
        background: #f3f3f3;
        .copy-button{
          opacity: 1;
        }
      }
      .hovered {
        background: #f3f3f3;
        .copy-button{
          opacity: 1;
        }
      }
      .action-wrap .main-settings-btn.active{
        opacity: 1;
      }
      .ReactVirtualized__Table__rowColumn {
        &:last-child{
          text-align: left;
        }
      }
    }
    .action-wrap {
      justify-content: center;
    }
    td{
      border: 0;
      padding: 0;
      vertical-align: middle;
    }
    .ReactVirtualized__Table__sortableHeaderColumn {
      position: relative;

      .sort-icon() {
        display: inline-flex;
        background-image: url(../../../components/Icon/icons/Arrow-Down-Small.svg);
        content: '';
        width: 24px;
        height: 24px;
      }

      .sort-asc, .sort-desc {
        position: relative;
        display: inline-flex;
        align-items: center;
      }
      .sort-asc{
        &::after{
          .sort-icon();
        }
      }
      .sort-desc{
        &::after{
          .sort-icon();
          transform: rotate(180deg);
        }
      }
    }
  }

  .last-File {
    cursor: pointer;
    &:hover{
      text-decoration: underline;
    }
  }

  .--dead-link {
    cursor: default;
    &:hover{
      text-decoration: none !important;
    }
  }

  .row {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .sharing-row{
    color: @blue;
  }

  .browse-table-viewer-header {
    overflow: hidden;
    background: #e4f2f7;
    height: 38px;
    flex-shrink: 0;

    .main-settings-holder{
      position: relative;
      display: inline-block;
      margin: 7px 0 8px;
      .button-white:last-child {
        margin-right: 0 !important;
      }
      .button-white:hover{
        background: #F9F9F9 !important;
      }
      .settings-button{
        padding: 0;
        border: 0;
        background: transparent;
        &.blue-btn{
          background: @blue;
          color: @white;
          border: 1px solid @blue;
          &:hover{
            background: darken(@blue, 5%);
          }
        }
        &.grey-btn{
          background: @blue;
          color: @white;
          border: 1px solid @blue;
        }
        &.active{
          background: #ccc;
        }
      }
    }

    .btn{
      .fa{
        font-size: 15px;
      }
    }
    .left-border{
      position: relative;
      margin-left: 10px !important;
      &::before{
        content: "";
        position: absolute;
        left: -10px;
        top: 0;
        bottom: 0;
        width: 1px;
        background: @border-grey-light;
      }
    }
  }
  .folder-path{
    cursor: pointer;
    color: @grey;
    .last-folder{
      color: @blue;
    }
  }
  .database-path{
    cursor: pointer;
    .last-folder{
      color: @blue;
    }
  }
  .table-path{
    cursor: pointer;
  }
  .help-btn{
    background: @white;
    border: 1px solid darken(@white, 15%);
    border-radius: 4px;
    padding: 1px 5px 2px 5px;
    cursor: pointer;
    .fa{
      font-size: 7px;
      line-height: 7px;
      color: #909090;
      margin: 0 2px;
      vertical-align: middle;
    }
    &:hover{
      background: darken(@white, 5%);
    }
  }
  .queries-row{
    color: @blue;
    cursor: pointer;
  }

  .request-access-holder{
    background: @light-blue;
    padding: 10px;
    button{
      width: auto;
      padding: 5px 20px;
    }
    .fa{
      font-size: 25px;
    }
    .request-access-inner{
      font-size: 12px;
      display: inline-block;
      overflow: hidden;
      vertical-align: top;
      margin: 0 10px;
      .title{
        font-size: 13px;
        font-weight: 500;
        margin: 0 0 7px;
      }
    }
  }
  .empty-table {
    .empty-message {
      display: flex;
      justify-content: center;
      align-items: center;
      position: absolute;
      height: 100%;
      width: 100%;
      text-align: center;
      font-size: 32px;
      color: #CBCBCB;
      background-color: #F8F8F8;
    }
    .table {
      margin-bottom: 0;
    }
  }

   // avoiding extra right margin on DS list page in Action column
   .main-info .ReactVirtualized__Table__row .ReactVirtualized__Table__rowColumn.row-buttons,
   .ReactVirtualized__Table__headerColumn.row-buttons {
     margin-right: 5px;
   }
 }
